<h1>Listing events</h1>

<table>
  <tr>
    <th>Title</th>
    <th>Start</th>
    <th>End</th>
    <th>Details</th>
    <th>Contact</th>
    <th>Location</th>
  </tr>

<% @events.each do |event| %>
  <tr>
    <td><%=h event.title %></td>
    <td><%=h event.start.strftime('%D %r') %></td>
    <td><%=h event.end.strftime('%D %r') %></td>
    <td><%=h event.details %></td>
    <td><%=h event.contact %></td>
    <td><%=h event.location_id %></td>
    <td><%= link_to 'Show', event %></td>
    <td><%= link_to 'Edit', edit_event_path(event) %></td>
    <td><%= link_to 'Destroy', event, :confirm => 'Are you sure?', :method => :delete %></td>
  </tr>
<% end %>
</table>

<br />

<%= link_to 'New event', new_event_path %>
